package com.ethink.framework.common.db;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ethink.framework.common.web.request.PageQueryRequest;

/**
 * 分页工具类
 *
 * @Author name(Tel : mobile)
 * @Date 2020-06-08 09:09
 **/
public class PageUtils {

    /**
     * 创建Page
     *
     * @param request
     * @return
     */
    public static Page buildPage(PageQueryRequest request) {
        Page page = new Page();
        page.setSize(request.getPageSize() == null ? 10 : request.getPageSize());
        page.setCurrent(request.getCurrent() == null ? 1 : request.getCurrent());
        return page;
    }

}
